<?php
/**
 * Project: ShopWorx- making your life easier
 *   
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @Author Chris 
 * @File common.php
 * @Version 1.0.0
 * @Copyright 2008 Shopworx (c) 
 * @Year 2008
 * @access Public 
 */

 /**
  *@ignore
  */

error_reporting(E_ALL);
require_once 'config.php';
require_once 'Includes/constants.php';
require_once 'DB.php';
require_once DBAL_CLASS;
$db_url = 'mysql://root:<>@localhost/shopworx';
$db = new DBAL($db_url);
$stmt = "SELECT * FROM config";
$result = $db->query($stmt);
if($result != null){

	while($row = $result->fetchRow()){
		define(strtoupper($row->config_name), $row->config_value);
	}
}


$DEBUG_STATUS = true;

if (defined('DEBUG_LOADED')) {
    include_once DEBUG_CLASS;
}
require_once ERR_CLASS;

if(DEBUG_MODE == true){
require_once DEBUG_CLASS;
}

require_once AUTH_CLASS;
require_once APP_CLASS;
require_once TEMPLATE_FRAMEWORK . '/Smarty.class.php';
require_once USER_CLASS;